package com.johndriver.selenium.explorer;

import com.johndriver.selenium.driver.DriverDemo;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;

import java.util.List;

/**
 * 定位
 * 日期 2021/5/22 18:30
 * 创建者：john driver
 */
public class Location {
    public static void main(String[] args) {
        WebDriver driver = DriverDemo.driver();
        driver.get("https://www.duquanben.com/");
        final WebElement container = driver.findElement(By.id("container"));
        final WebElement element = driver.findElement(By.cssSelector("#container div.hot-box"));
        final List<WebElement> elements = driver.findElements(By.cssSelector("#conten > div"));
        final List<WebElement> li = driver.findElements(new By.ByTagName("li"));
        final WebElement element1 = driver.findElement(new By.ByClassName("fn-clear"));
        final WebElement div2 = driver.findElement(By.xpath("//div[@id='container']/div[2]"));
        driver.close();
    }
}
